package com.xxx.yuedong.oss.utils;

import com.xxx.yuedong.course.pojo.Course;

public enum TypeEnum {
    //上传头像
    AVATER("avatar"),
    //上传活动图片
    ACTIVITY_PHOTO("activity_photo"),
    //上传视频
    VIDEO("video"),
    //上传动态图片
    DYNAMIC("dynamic"),
    //上传商品图片
    GOODS_PHOTO("goods_photo"),
    //上传课程封面
    COURSE_PHOTO("course_photo"),
    // 上传课程视频
    COURSE_VIDEO("course_video");

    private String key;

    TypeEnum(String key) {
        this.key = key;
    }

    private String getKey() {
        return key;
    }

    public static TypeEnum findByKey(String key) {
        if (key != null) {
            for (TypeEnum type : TypeEnum.values()) {
                if (key.equals(type.getKey())) {
                    return type;
                }
            }
        }

        return null;
    }
}